package com.gzxx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gzxx.domain.po.SysUserDept;
import com.gzxx.domain.vo.SysUserDeptVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * SysUserDeptMapper
 *
 * @author chenjing
 */
public interface SysUserDeptMapper extends BaseMapper<SysUserDept> {

    /**
     * 根据用户ID删除关联部门
     */
    int deleteByUserId(@Param("userId") Long userId);

    /**
     * 批量查询二级部门所有关联用户
     */
    List<Long> queryBachByDeptIds(@Param("deptIds") List<Long> deptIds);

    /**
     * 查询用户所属部门
     */
    SysUserDeptVo queryByUserId(@Param("userId") Long userId);

    /**
     * 根据用户批量删除
     */
    int deleteBachByUserIds(@Param("userIds") List<Long> userIds);
}
